function checkAge(age) {
    let ret = false;
    age > 18 ? (ret = true) : ret = confirm('Do you have your parents permission to access this page?');
    return ret;
}

let age = +prompt('Input your age:');

alert(checkAge(age));